#include <QBitmap>

#include "Splash.h"
#include "ui_Splash.h"

Splash::Splash(QWidget *parent) :
    QDialog(parent, Qt::SplashScreen),
    m_ui(new Ui::Splash)
{
    m_ui->setupUi(this);
    QPixmap pixmap(":/about.png");
    setMask(pixmap.mask());
}

Splash::~Splash()
{
    delete m_ui;
}

void Splash::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void Splash::setLoadStep(int step)
{
    m_ui->loadText->setStyleSheet(QString("background-image: url(:/lstep-%1.png);").arg(step));
    m_ui->progressBar->setValue(step);
    repaint();
}
